import request from '@/utils/request'

// 获取校区列表
export function getSchoolList() {
  return request({
    url: 'clmall/school/all',
    method: 'get',
  })
}
// 获取商品列表
export function getGoodsList(schoolId) {
  return request({
    url: `clmall/goods/goods/${schoolId}`,
    method: 'get',
  })
}

// 创建订单
export function createOrder(data) {
  return request({
    url: 'clmall/order/create',
    method: 'post',
    data
  })
}

// 上传图片
export function uploadFile(data) {
  return request({
    url: 'clmall/file/uploads',
    method: 'put',
    data,

    headers: {
      "Content-Type": "application/octet-stream", // 修正 Content-Type 的拼写错误
      "Custom-Header": "custom-value" // 自定义头部示例
    }
  })
}

// 身份证识别
export function idCard(fileId) {
  return request({
    url: `clmall/ali/idcard/${fileId}`,
    method: 'get',

  })
}

// 根据手机号查用户信息
export function getUserInfo(phone) {
  return request({
    url: `app/clmall/order/getUserInfo/${phone}`,
    method: 'get',
  })
}